﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Dapper;
using TimerTask.Common.Utils;
using TimerTask.Model.Entity;

namespace TimerTask.Dal
{
    public class AlarmLogDal : BaseDal
    {
        public void AddAlarmLog(AlarmLog model)
        {
            string sql =
                @"INSERT INTO alarmlog (JobId, Mode, AlarmTime, Result) VALUES (?JobId, ?Mode, ?AlarmTime, ?Result);";
            try
            {
                DbConnection.Execute(sql, model);
            }
            catch (Exception exception)
            {
                LogUtil.Error(exception, "增加警告记录有误{0}", model.ToJson());
                throw;
            }
        }
    }
}
